package com.jhs.boot.system.service;

import com.jhs.boot.common.result.Result;
import com.jhs.boot.system.model.vo.NodesThirdVO;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.service.annotation.GetExchange;
import org.springframework.web.service.annotation.PostExchange;

import java.util.List;

//@HttpExchange(url = "${mesh.url}",accept  = "application/vnd.github.v3+json")
public interface FeignService {
    /**
     * MMS重启设备
     * @param ip
     * @param type
     * @return
     */
    @GetExchange(value = "/wifimesh/reboot",accept = "application/json")
//    @GetExchange(value = "/338761533",accept = "application/json")
    Result<NodesThirdVO> reboot( @RequestParam(name="ip") String ip,@RequestParam(name="type") Integer type );
    /**
     * MMS获取心跳
     * @param ip
     * @param type
     * @return
     */
    @GetExchange(value = "/wifimesh/heartbeat",accept = "application/json")
//    @GetExchange(value = "/338606130",accept = "application/json")
    Result<NodesThirdVO> heartMpp(@RequestParam(name="ip") String ip ,@RequestParam(name="type") Integer type );

    /**
     * MMS获取心跳
     * @param ip
     * @param type
     * @return
     */
//    @GetExchange(value = "/338622783",accept = "application/json")
    @GetExchange(value = "/wifimesh/heartbeat",accept = "application/json")
    Result<NodesThirdVO> heartMap(@RequestParam(name="ip") String ip,@RequestParam(name="type") Integer type );

    /**
     * MMS获取终端
     * @param ip
     * @param type 0-终端 1-RFID
     * @return
     */
    @GetExchange(value = "/wifimesh/clientinfo_get",accept = "application/json")
//    @GetExchange(value = "/338766140",accept = "application/json")
    Result<List<NodesThirdVO>>  getInfoTernimal(@RequestParam(name="ip") String ip, @RequestParam(name="type") Integer type);

    /**
     * MMS获取配置
     * @param ip
     * @param cfg_item
     * @param type 0-MPP 1-MAP
     * @return
     */
    @GetExchange(value = "/wifimesh/config_get",accept = "application/json")
//    @GetExchange(value = "/340616773",accept = "application/json")
    Result  getConfig(@RequestParam(name="ip") String ip,
                     @RequestParam(name="cfg_item") String cfg_item,
                     @RequestParam(name="type") Integer type);

    /**
     * MMS设置节点的配置
     * @param ip
     * @param cfg_item
     * @param type 0-MPP 1-MAP
     * @param text
     * @return
     */
    @PostExchange(value = "/wifimesh/config_set",accept = "application/json")
//@PostExchange(value = "/340619822",accept = "application/json")
    Result  updateSet(@RequestParam(name="ip") String ip,
                      @RequestParam(name="cfg_item") String cfg_item,
                      @RequestParam(name="type") Integer type,
                      @RequestBody String text);

    /**
     *  MMS主动请求节点上线
     * @param ip MPP/MAP lan口IP地址
     * @param type 0-MPP 1-MAP
     * @return
     */
    @GetExchange(value = "/wifimesh/upreq_again",accept = "application/json")
//    @GetExchange(value = "/340616773",accept = "application/json")
    Result  askOnline(@RequestParam(name="ip") String ip,
                      @RequestParam(name="type") Integer type);

    /**
     *
     * @param ip map的lan口IP地址
     * @param type  0-MPP 1-MAP
     * @return
     */
    @GetExchange(value = "/wifimesh/dhcp_get",accept = "application/json")
//    @GetExchange(value = "/368907710",accept = "application/json")
    Result<List<NodesThirdVO>>  dhcpGet(@RequestParam(name="ip") String ip,
                      @RequestParam(name="type") Integer type);

}
